package com.service.impl;

import com.entity.Flower;
import com.mapper.FlowerMapper;
import com.service.FlowerService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Data
@Service
public class FlowerServiceImpl implements FlowerService {
    @Autowired
    private FlowerMapper flowerMapper;
    @Override
    public List<Flower> selectAllFlowers() {
        return flowerMapper.selectAllFlowers();
    }

    @Override
    public Flower selectOneFlowerById(int id) {
        return flowerMapper.selectOneFlowerById(id);
    }

    @Override
    public int deleteOneFlowerById(int id) {
        return flowerMapper.deleteOneFlowerById(id);
    }

    @Override
    public List<Flower> selectOneFlowerByName(String flowerName) {
        return flowerMapper.selectOneFlowerByName(flowerName);
    }


    @Override
    public int insertOneFlower(Flower flower) {
        return flowerMapper.insertOneFlower(flower);
    }

    @Override
    public int updateOneFlower(Flower flower) {
        return flowerMapper.updateOneFlower(flower);
    }
}
